---
title: 使用root用户SSH登录服务器出现Access Denied错误
description: 使用root用户SSH登录服务器出现“Access Denied”错误。
url: "https://www.hiascend.com/document/detail/zh/Atlas%20200I%20A2/260RC1/RC/driverdevelopmentguide/atlasdg_11_0180.html"
---

# 使用root用户SSH登录服务器出现Access Denied错误

#### 问题描述

使用root用户SSH登录服务器出现“Access Denied”错误。


#### 原因分析

sshd_config配置文件中PermitRootLogin字段的值为no，不允许远程登录。


#### 解决方法

1. 使用HwHiAiUser账号登录OS后台。
2. 执行以下命令，切换root账户。
  su root

  输入默认密码，默认密码请参见《Atlas 系列硬件产品 账户清单(https://support.huawei.com/enterprise/zh/doc/EDOC1100235027)》。

3. 执行以下命令，修改sshd_config文件。
  vim /etc/ssh/sshd_config

  在该行后添加一行PermitRootLogin yes。

```
#PermitRootLogin prohibit-password
PermitRootLogin yes
```


  配置完成后，按“Esc”键，再执行:wq!保存修改，并按“Enter”键退出。

4. 执行如下命令，重启ssh。

```
/etc/init.d/ssh restart
```


5. 重新使用ssh远程连接。
